#ifndef MYCONSOLE3_NETWORKING_H
#define MYCONSOLE3_NETWORKING_H

#include <QTcpServer>
#include <QTcpSocket>
#include <QWaitCondition>

class MyConsoleClient;

class MyConsole3_networking :public QTcpServer
{
public:
    MyConsole3_networking(QObject *parent = 0);

    bool beginListen();

    static QWaitCondition waitConditon;


private:
    void incomingConnection(int socketId);

    MyConsoleClient *_socket;

public:

     void outputString(QString);
     QString getInputString(QString);
};



class MyConsoleClient : public QTcpSocket
{
    Q_OBJECT

public:
    MyConsoleClient(QObject *parent = 0);
    QString getString(){
        return _str;
    }

    bool isReady;
private slots:
    void readClient();

private:
    QString _str;

};


#endif // MYCONSOLE3_NETWORKING_H
